/**
 * http响应类
 */
class Response {
    constructor() {
        this.code = 200;
        this.msg = "success";
        this.data = null;
    }

    // 成功响应
    success(data) {
        this.data = data;
        return this;
    }

    // 失败响应
    fail(code, msg) {
        this.code = code;
        this.msg = msg;
        return this;
    }
}

module.exports = Response;